-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Install xargo using CI dictated cargo version if available #9068
Conversation
FYI looks like |
@jstarry Cool, I'll both set the stable version as the default toolchain and rip out update and replace with |
Codecov Report
@@ Coverage Diff @@
## master #9068 +/- ##
========================================
+ Coverage 80.4% 80.4% +<.1%
========================================
Files 268 268
Lines 58796 58796
========================================
+ Hits 47320 47326 +6
+ Misses 11476 11470 -6 |
Agreed, not going to set default toolchain |
set -e | ||
cargo install-update -i xargo | ||
set -ex | ||
cargo +"${rust_stable:-}" install xargo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mvines know any cool bash tricks to improve this?
set -e | ||
cargo install-update -i xargo | ||
set -ex | ||
cargo +"${rust_stable:-}" install xargo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd just go with a simple approach:
cargo +"${rust_stable:-}" install xargo | |
if [[ -n $rust_stable ]]; then | |
cargo +"$rust_stable" install xargo | |
else | |
cargo install xargo | |
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shellcheck does not like this since it can't tell if rust_stable is defined (rust_stable should probably be in all caps) and would rather not have to clutter up with a spellcheck "allow" statement
(cherry picked from commit 30bed18)
Problem
The SDK install script attempts to install xargo which is required to build Rust BPF programs. The script uses whatever version of cargo is installed on the host machine to do so. in CI the version of cargo is always explicit and the machine's default toolchain is not updated, consequently the CI machines default version is very old. This old version does not support installing the latest version of xargo.
Summary of Changes
rust_stable
.cargo install
now installs the latest version of a package so remove the use ofcargo install-update
Fixes #